<template>
  <div class="app-container">
    <h1>App 根组件</h1>{{ count }}
    <hr />

    <div class="box">
      <!-- 渲染 Left 组件和 Right 组件 -->
      <Left :name="name" :count ="count" @changeCount="changeCount"></Left>
      <Right> </Right>
    </div>
  </div>
</template>

<script>
import Left from '@/components/Left.vue'
import Right from '@/components/Right.vue'
export default {
  data() {
    return {
      name:'父亲的文字',
      count:1
    }
  },

  components:{
    Left,Right
  },
  methods: {
    changeCount(value){
      this.count=value
    }
  },
}
</script>

<style lang="less">
.app-container {
  padding: 1px 20px 20px;
  background-color: #efefef;
}
.box {
  display: flex;
}
</style>
